﻿using LJX.SmartPark.Common.ResponseOutput;
using LJX.SmartPark.Domain.IotInfo.LightPoles;
using LJX.SmartPark.Domain.SysManage;
using LJX.SmartPark.Service.SysManage;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace LJX.SmartPark.WebApi.Controllers.SysManage
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    [ApiExplorerSettings(GroupName = "SysManage")]
    public class DepartManageController : ControllerBase
    {
        private readonly IDepartManageServeice _departManageServeice;

        public DepartManageController(IDepartManageServeice departManageServeice)
        {
            _departManageServeice = departManageServeice;
        }

        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        public Task<Response<bool>> PostAddDepartManage(DepartManage input)
        {
            var result = _departManageServeice.PostAddDepartManageListAsync(input);
            return result;
        }

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="input"></param>
        [HttpDelete]
        public Task<Response<bool>> DeleteDepartManage(DepartManage input)
        {
            var result = _departManageServeice.DeleteDepartManageAsync(input);
            return result;
        }

        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPut]
        public Task<Response<bool>> PutUpdateDepartManage(DepartManage input)
        {
            var result = _departManageServeice.PutUpdDepartManageAsync(input);

            return result;

        }

        /// <summary>
        /// 显示
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public Response<List<DepartManage>> GetDepartManageAsync()
        {
            var result = _departManageServeice.GetDepartManageAsync();
            return result;
        }

        /// <summary>
        /// 查询
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        public Response<DepartManage> GetDepartManageById(DepartManage input)
        {
            var result = _departManageServeice.GetDepartManageById(input);
            return result;
        }
    }
}
